package com.ruoyi.business.question;

/**
 * @author 最爱喝兽奶
 * @create 2022/8/9
 **/
public class QuestionHandleFactory {

    /**
     * 单选
     */
    public static String SINGLE_CHOICE_QUESTION = "0";

    /**
     * 多选
     */
    public static String MULTIPLE_CHOICE_QUESTION = "1";

    /**
     * 判断
     */
    public static String JUDGE_QUESTION = "2";

    /**
     * 填空
     */
    public static String FILL_QUESTION = "3";

    /**
     * 主观题
     */
    public static String SUBJECTIVE_QUESTION = "4";

    public static QuestionHandle createQuestionHandle(String type){
        if (SINGLE_CHOICE_QUESTION.equals(type)) {
            return new SingleChoiceQuestionHandle();
        }else if (MULTIPLE_CHOICE_QUESTION.equals(type)) {
            return new MultipleChoiceQuestionHandle();
        } else if (JUDGE_QUESTION.equals(type)) {
            return new JudgeQuestionHandle();
        } else if (FILL_QUESTION.equals(type)) {
            return new FillQuestionHandle();
        } else if (SUBJECTIVE_QUESTION.equals(type)) {
            return new SubjectiveQuestionHandle();
        }
        return null;
    }

}
